<template>
  <div class="container recommend">
    <img src="./images/recommend-author.png" class="banner" />
    <a href="" class="help">
      <i class="iconfont icon-jiahao"></i>
      如何成为签约作者?
    </a>
    <div class="row">
      <div
        class="col-xs-4"
        v-for="(authorItem, index) in recommendAuthor.users"
        :key="index"
      >
        <div class="wrap">
          <!-- 作者信息 -->
          <a href="">
            <img class="avatar" :src="authorItem.avatar_source" />
            <h4 class="author">{{ authorItem.nickname }}</h4>
            <p class="description">
              欢迎我的个人公众号:babalabalabalabalababalabalabalabalababalabalabalabalababalabala
            </p>
          </a>
          <!-- +关注 -->
          <a href="" class="btn btn-success follow">
            <i class="iconfont icon-jiahao"></i>
            <span>关注</span>
          </a>
          <div class="meta">最近更新</div>
          <hr />
          <!-- 最近文章标题-->
          <div class="recent">
            <a class="new" href="">28条帮助你全面思考的系统思维法则</a>
            <a class="new" href=""
              >让这个夏天所有的遗憾，都成为秋天惊喜的铺垫</a
            >
            <a class="new" href="">法国惊魂:9000元的LV,引来恐怖的女贼?</a>
          </div>
        </div>
      </div>

      <!-- 阅读更多 -->
      <a href="" class="loadMore">
        下载更多
      </a>
    </div>
  </div>
</template>

<script>
import { mapState, mapGetters } from "vuex";
export default {
  name: "Person",
  mounted() {
    this.$store.dispatch("getIndexData");
  },
  computed: {
    ...mapState({
      initData: (state) => state.home.initData,
    }),
    ...mapGetters(["recommendAuthor"]),
  },
};
</script>

<style lang="less" scoped>
.recommend {
  width: 960px;
  padding: 30px 0 50px;
  text-align: center;
  position: relative;
}
.row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
}
.banner {
  width: 100%;
  min-height: 100px;
  background-color: hsla(0, 0%, 71%, 0.2);
  border-radius: 6px;
}
.help {
  position: absolute;
  right: 30px;
  top: 68px;
  color: #fff !important;
  font-size: 17px;
}
.recommend .wrap {
  height: 320px;
  margin-top: 80px;
  padding: 0 20px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  background-color: hsla(0, 0%, 71%, 0.1);
}
.recommend .wrap .avatar {
  border-radius: 40px;
  width: 80px;
  height: 80px;
  margin: -40px 0 10px;
  display: inline-block;
  border: 1px solid #ddd;
  background-color: #fff;
}
.recommend .wrap h4 {
  font-size: 21px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recommend .wrap .description {
  margin: 10px auto;
  line-height: 2;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.recommend .wrap .btn {
  width: 100px;
  height: 38px;
  padding: 8px 0;
}
.btn-success {
  border-radius: 40px;
  color: #fff !important;
  background-color: #42c02e;
}
.follow {
  border-color: #42c02e;
  font-size: 16px;
  display: block;
  margin: 0 auto;
}
.recommend .btn span {
  margin-left: 3px;
}
.recommend .meta {
  float: left;
  margin-top: 12px;
  padding-right: 10px;
  font-size: 12px;
  color: #969696;
  background-color: #f8f8f8;
}
.recommend .recent {
  height: 75px;
}
.recommend .recent .new {
  font-size: 13px;
  line-height: 25px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  text-align: center;
}
.loadMore {
  width: 100%;
  background-color: #a5a5a5;
  border-radius: 20px;
  height: 40px;
  margin: 30px auto 60px;
  padding: 10px 15px;
  text-align: center;
  font-size: 15px;
  color: #fff !important;
  display: block;
}
</style>
